//
//  YSRequestConfig.h
//  p4
//
//  Created by Yuxin on 14/11/4.
//  Copyright (c) 2014年 me.yang-yuxin. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>

#define YSREQUESTCONFIG_DEFAULTNAMESPACE @"default"

typedef NSDictionary * _Nonnull (^YSRequestHookExtraParamBlock)();
typedef void (^YSRequestHookRequestBlock)(_Nonnull id YSrequest);
NS_ASSUME_NONNULL_BEGIN
@interface YSRequestConfig : NSObject

@property (nonatomic, copy) NSString *serviceKey;
@property (nonatomic, readonly) NSMutableDictionary *config;/**< json 文件内容 */
@property (nonatomic, copy) NSString *configName;/**< json 文件名，不包含后缀名 */


// 图片相关
@property (nonatomic, copy) NSString *defaultUploadImageName;/**< 默认图片名为 attachment */
@property (nonatomic, copy) NSString *defaultUploadImageType;/**< 默认图片类型为 image/jpeg */
@property (nonatomic, assign) CGFloat defaultUploadImageCompressionQuality;/**< 默认压缩比为 1 */

// 配置额外参数（例如IP,DeviceToken 。。。）
@property (nonatomic, copy) YSRequestHookExtraParamBlock hookExtraParamBlock;
@property (nonatomic, copy) YSRequestHookRequestBlock hookRequestBlock;

+ (instancetype)shared;

- (NSString *)urlStringFromName:(NSString *)name;

@end
NS_ASSUME_NONNULL_END
